package cn.edu.scau.cmi.lixiaoyuan.mybatis.sqlUtils;

import org.springframework.stereotype.Component;


public class StudentSql {
      
	public static String Sql2findStudentByProperty(String property,Object value) {
		String result;
		if(value.getClass().equals(String.class)) {
			result = "select s.* from student s where s."+property+"="+"'"+value+"'";
		}else {
		    result = "select s.* from student s where s."+property+"="+value;
		}
		
		return result;
	}
	
	public static String Sql2updateStudentByProperty(String property,Object value) {
		String result;
		if(value.getClass().equals(String.class)) {
			result = "update ";
		}else {
		    result = "select s.* from student s where s."+property+"="+value;
		}
		
		return result;
	}
	
	
}
